<template>
  <div :class="is_mobile ? 'i_m' : 'i_pc'">
    <router-view></router-view>
  </div>
</template>

<script>
import "@/css/main.scss";
export default {
  data() {
    return {
      screenWidth: null,
      is_mobile: null
    };
  },
  created() { },
  mounted() {
    if (this.isMobile()) {
      this.is_mobile = true;
    } else {
      this.is_mobile = false;
    }
  },
  methods: {
    isMobile() {
      let flag = navigator.userAgent.match(
        /(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i
      );
      return flag
    },
  }
}
</script>
<style scoped>
.i_m {
  background: red;
}
.i_pc {
  background: yellow;
}
</style>
